﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EasyDentalMail.BO
{
    public class Utils
    {
        public static string convertHora(int? hora)
        {
            string str = "{0}:{1}:00";
            if (hora != null)
            {
                int div = (int)hora / 60000;
                int rest = div % 60;
                int valor = (int)div / 60;
                str = string.Format(str, valor, rest.ToString("00"));
                return str;
            }

            return null;
        }

        public static int convertHoraED(DateTime? data)
        {
            if (data == null)
                return 0;
            int min = data.Value.Minute;
            int hora = data.Value.Hour;
            int ValorTotal = hora * 60;
            ValorTotal += min;
            ValorTotal *= 60000;
            return ValorTotal;
        }

        
    }
}
